import { useDigital, useLocale } from "@/hooks"

// Defining the interface based on the Vue table columns
export interface TableData {
	userName: string
	parentProxyName: string
	merchantId: string | number
	merchantName: string
	loginLockStatus: number
	gameLockStatus: number
	paymentLockStatus: number
	createdAt: string
	loanBillSnapshotTime: string
	currency: string
	asset: number
	shouldRepay: number
	withdrawAvailable: number
	cashAvailable: number
	creditAvailable: number
	creditTotal: number
	historyBillPeriod: string
	generatedTime: string
	historyAsset: number
	historyShouldRepay: number
	historyWithdrawAvailable: number
	historyCashAvailable: number
	historyCreditAvailable: number
	historyCreditTotal: number
	applyUserName: string
	eventTime: string
	adjustTypeStr: string
	orderAmount: number
}

const memberBillWithdrawalSubAuditRecordDetailColumns = () => {
	const { newFormat } = useLocale()
	const { renderFormat } = useDigital()

	const memberBillWithdrawalSubAuditRecordDetail_userName = {
		title: "funds.user_name",
		width: 160
	}
	const memberBillWithdrawalSubAuditRecordDetail_parentProxyName = {
		title: "funds.fund_audit.belong_proxy",
		width: 160
	}
	const memberBillWithdrawalSubAuditRecordDetail_merchantId = {
		title: "common.belong_merchant",
		width: 160
	}
	const memberBillWithdrawalSubAuditRecordDetail_merchantName = {
		title: "common.belong_merchant",
		width: 160
	}
	const memberBillWithdrawalSubAuditRecordDetail_accountStatus = {
		title: "common.account_status",
		width: 100,
		render: (_: any, record: TableData) => {
			return (
				<>
					{record.loginLockStatus === 1 && <span className="disableRgba">{newFormat("common.login_lock_status")}</span>}
					{record.paymentLockStatus === 1 && <span className="deleteRgba">{newFormat("common.account_lock_status")}</span>}
					{record.gameLockStatus === 1 && <span className="lockingRgba">{newFormat("common.game_lock_status")}</span>}
					{record.loginLockStatus === 0 && record.paymentLockStatus === 0 && record.gameLockStatus === 0 && (
						<span className="normalRgba">{newFormat("common.account_status_normal")}</span>
					)}
				</>
			)
		}
	}

	const memberBillWithdrawalSubAuditRecordDetail_createdAt = {
		title: "report.register_date",
		width: 130
	}
	const memberBillWithdrawalSubAuditRecordDetail_loanBillSnapshotTime = {
		title: "funds.fund_audit.snapshot_time",
		width: 160
	}
	const memberBillWithdrawalSubAuditRecordDetail_asset = {
		title: "funds.settlement_bill_management.bill_net_assets",
		width: 160,
		render: renderFormat
	}
	const memberBillWithdrawalSubAuditRecordDetail_shouldRepay = {
		title: "funds.settlement_bill_management.payable_bill_loan",
		width: 160,
		render: renderFormat
	}
	const memberBillWithdrawalSubAuditRecordDetail_withdrawAvailable = {
		title: "funds.settlement_bill_management.withdrawable_limit",
		width: 160,
		render: renderFormat
	}
	const memberBillWithdrawalSubAuditRecordDetail_cashAvailable = {
		title: "report.center_wallet_balance",
		width: 160,
		render: renderFormat
	}
	const memberBillWithdrawalSubAuditRecordDetail_creditAvailable = {
		title: "funds.settlement_bill_management.credit_wallet_balance",
		width: 160,
		render: renderFormat
	}
	const memberBillWithdrawalSubAuditRecordDetail_creditTotal = {
		title: "funds.fund_audit.credit_limit",
		width: 160,
		render: renderFormat
	}
	const memberBillWithdrawalSubAuditRecordDetail_historyBillPeriod = {
		title: "funds.fund_audit.bill_date",
		width: 160
	}
	const memberBillWithdrawalSubAuditRecordDetail_generatedTime = {
		title: "funds.fund_audit.generation_time",
		width: 160
	}
	const memberBillWithdrawalSubAuditRecordDetail_historyAsset = {
		title: "funds.settlement_bill_management.bill_net_assets",
		width: 160,
		render: renderFormat
	}
	const memberBillWithdrawalSubAuditRecordDetail_historyShouldRepay = {
		title: "funds.settlement_bill_management.payable_bill_loan",
		width: 160,
		render: renderFormat
	}
	const memberBillWithdrawalSubAuditRecordDetail_historyWithdrawAvailable = {
		title: "funds.settlement_bill_management.withdrawable_limit",
		width: 160,
		render: renderFormat
	}
	const memberBillWithdrawalSubAuditRecordDetail_historyCashAvailable = {
		title: "report.center_wallet_balance",
		width: 160,
		render: renderFormat
	}
	const memberBillWithdrawalSubAuditRecordDetail_historyCreditAvailable = {
		title: "funds.settlement_bill_management.credit_wallet_balance",
		width: 160,
		render: renderFormat
	}
	const memberBillWithdrawalSubAuditRecordDetail_historyCreditTotal = {
		title: "funds.fund_audit.credit_limit",
		width: 160,
		render: renderFormat
	}
	const memberBillWithdrawalSubAuditRecordDetail_applyUserName = {
		title: "funds.fund_audit.operator",
		width: 160
	}
	const memberBillWithdrawalSubAuditRecordDetail_eventTime = {
		title: "funds.apply_time",
		width: 160
	}
	const memberBillWithdrawalSubAuditRecordDetail_adjustTypeStr = {
		title: "funds.fund_audit.adjust_type",
		width: 160
	}
	const memberBillWithdrawalSubAuditRecordDetail_orderAmount = {
		title: "funds.fund_audit.order_amount",
		width: 160,
		render: renderFormat
	}

	return {
		memberBillWithdrawalSubAuditRecordDetail_userName,
		memberBillWithdrawalSubAuditRecordDetail_parentProxyName,
		memberBillWithdrawalSubAuditRecordDetail_merchantId,
		memberBillWithdrawalSubAuditRecordDetail_merchantName,
		memberBillWithdrawalSubAuditRecordDetail_accountStatus,
		memberBillWithdrawalSubAuditRecordDetail_createdAt,
		memberBillWithdrawalSubAuditRecordDetail_loanBillSnapshotTime,
		memberBillWithdrawalSubAuditRecordDetail_asset,
		memberBillWithdrawalSubAuditRecordDetail_shouldRepay,
		memberBillWithdrawalSubAuditRecordDetail_withdrawAvailable,
		memberBillWithdrawalSubAuditRecordDetail_cashAvailable,
		memberBillWithdrawalSubAuditRecordDetail_creditAvailable,
		memberBillWithdrawalSubAuditRecordDetail_creditTotal,
		memberBillWithdrawalSubAuditRecordDetail_historyBillPeriod,
		memberBillWithdrawalSubAuditRecordDetail_generatedTime,
		memberBillWithdrawalSubAuditRecordDetail_historyAsset,
		memberBillWithdrawalSubAuditRecordDetail_historyShouldRepay,
		memberBillWithdrawalSubAuditRecordDetail_historyWithdrawAvailable,
		memberBillWithdrawalSubAuditRecordDetail_historyCashAvailable,
		memberBillWithdrawalSubAuditRecordDetail_historyCreditAvailable,
		memberBillWithdrawalSubAuditRecordDetail_historyCreditTotal,
		memberBillWithdrawalSubAuditRecordDetail_applyUserName,
		memberBillWithdrawalSubAuditRecordDetail_eventTime,
		memberBillWithdrawalSubAuditRecordDetail_adjustTypeStr,
		memberBillWithdrawalSubAuditRecordDetail_orderAmount
	}
}

export default memberBillWithdrawalSubAuditRecordDetailColumns
